﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace Reviewer.Entities.Services
{

    /// <summary>
    /// Front Page Post Service Interface
    /// </summary>
    [ServiceContract(Namespace = "Reviewer.Services")]
    public interface IFrontPagePostService : IDisposable
    {
        /// <summary>
        /// Finds all frontpage posts
        /// </summary>
        [OperationContract]
        ICollection<FrontPagePost> FindAll(int topCount);

        /// <summary>
        /// Finds the specified p.
        /// </summary>
        /// <param name="p">The p.</param>
        /// <returns></returns>
        [OperationContract]
        FrontPagePost Find(int id);
        
        /// <summary>
        /// Finds the specified is active.
        /// </summary>
        /// <param name="isActive">if set to <c>true</c> [is active].</param>
        /// <param name="maxResults">The max results.</param>
        /// <returns></returns>
        [OperationContract]
        ICollection<FrontPagePost> Find(bool isActive, int maxResults);
    }

    /// <summary>
    /// Front Page Post Administration Service Interface
    /// </summary>
    [ServiceContract(Namespace = "Reviewer.Services")]
    public interface IFrontPagePostAdminService : IDisposable
    {
        /// <summary>
        /// Saves the specified post.
        /// </summary>
        /// <param name="post">The post.</param>
        /// <returns></returns>
        [OperationContract]
        FrontPagePost Save(FrontPagePost post);

        /// <summary>
        /// Deletes frontpage post
        /// </summary>
        /// <param name="id">The frontpage post id.</param>
        [OperationContract]
        void Delete(int id);
    }

}
